function loadContent(elementSelector, sourceUrl) {
	$.ajax({
		url : sourceUrl,
		success : function(results) {
			$(elementSelector).html(results);
		}
	});
}

function refreshOverlay(sourceUrl, targetSuccessUrl, successMessage) {
	$.ajax({
		url : sourceUrl,
		success : function(results) {
			alert(successMessage);
			closeOverlay();
			loadContent('#divContent', targetSuccessUrl);
		}
	});
}

function showOverlay(title, width, top, left){
	$.blockUI({
		title : title,
		draggable : true,
		themedCSS : {
			width : width,
			top : top,
			left : left
		},
		overlayCSS : {
			backgroundColor : '#000',
			opacity : 0.6,
			cursor : 'wait'
		},
		focusInput : true,
		centerX : true,
		centerY : true,
		cursorReset : 'default',
		showOverlay : true,
		message : $('#overlayContent'),
		theme : true
	});
}

function closeOverlay(){
	$.unblockUI();
	$('#overlayContent').addClass('hidden');
}